package com.annotation;


import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.annotation.service.AnnotationService;
@Component
public class QualifierResoutce {
	
	@Autowired
	@Qualifier("annotationServiceImpl2")
//	@Resource(name="annotationServiceImpl2")
	public AnnotationService as;
	
	@Resource
	public List<AnnotationService> list;
	
	@Resource
	public Map<String,AnnotationService> map;
	
	public void p(){
		System.out.println("QualifierResoutce");
		as.p();
	}
	
	public void print(){
		System.out.println("-----list存放------");
		for(AnnotationService a:list){
			System.out.println(a.getClass().getName());
		}
		System.out.println("-----map存放------");
		for(Entry<String, AnnotationService> e:map.entrySet()){
			System.out.println(e.getKey()+"   "+e.getValue());
		}
	}
}
